#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <math.h>

int main() {
    int n = 0;
    scanf("%d", &n);
    int x = 0;
    int max = 0;
    while (n--)
    {
        scanf("%d", &x);
        max = (sqrt(x) != (int)sqrt(x) && x > max) ? x : max;
    }
    //printf("%d\n",x);
    printf("%d", max);
    return 0;
}